#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
// 僵尸进程
int g_val =10;


int main()
{
  printf("hello world\n");
  pid_t pid = fork();
  if(pid == 0)
  {
    sleep(5);
    g_val = 100;
    printf("this is child!  %d\n" ,g_val);
    exit(0);
  }
  else if(pid >0)
  {
    printf("this is parents! %d\n", g_val);

  }
  else
  {  //创建出错   
  }

  printf("hi hi hi\n");

  while(1)
    sleep(1); //死循环


  return 0;
}
